<%@ include file="/WEB-INF/jsp/include/skin_head.jsp" %><%@ page language="java" pageEncoding="UTF-8" %>
    <div id="pw_bbs" style="width: ${project.specWidth}px;">
        <div id="pw_bbs_hader">${bbsType.bbsTopContent}</div>
        <div id="pw_bbs_body">
            <div id="pw_bbs_subject">
                <img src="<c:url value="/img/skin/${project.projectSkin}/title.gif"/>" class="pw_bsc" />
                <strong>${project.projectName}</strong> 
            </div>
            <div id="pw_bbs_comment">
            <c:if test="${not empty bbsType.bbsComment}">
                ${bbsType.bbsComment}
            </c:if>
            </div>
            <div id="pw_bbs_skin">

                <div id="pw_bbs_read">
                    <div id="pw_bbs_read_header"></div>
                    <div class="pw_bbs_read_box">
                        <div class="title">
                            ${spec.specTitle}
                        </div>
                        <div class="user">
                            <c:if test="${empty spec.userNick}">
                            <label><spring:message code="bbs.userNick" /></label>
                            </c:if> 
                            ${spec.userNick}
                            <c:if test="${not empty spec.userEmail}">
                            <img src="<c:url value="/img/skin/${project.projectSkin}/i_email.gif" />" class="pw_bsc" />
                            <span class="email">${spec.userEmail}</span>
                            <span class="pw_eml_red">@</span>
                            </c:if>
                            <c:if test="${not empty spec.userHomepage}">
                            <img src="<c:url value="/img/skin/${project.projectSkin}/i_home.gif" />" class="pw_bsc" /> 
                            <span class="homepage"><a href="${spec.userHomepage}">${spec.userHomepage}</a></span>
                            </c:if>
                        </div>
                        <div>
                            <div class="url">
                                <a href="<c:url value="/article/spec/" />${spec.sid}" class="pw_gray"><spring:message code="DOMAIN" /><c:url value="/article/spec/" />${spec.sid}</a>
                            </div>
                            <div class="regdt">
                                ${spec.modifyDate} ${spec.modifyTime}
                            </div>
                        </div>
                        <div class="content">
                            <!--pre></pre-->
                            ${spec.specDescription}
                        </div>
                        <c:forEach items="${spec.fileList}" var="file" varStatus="status">
                        <div class="attach">
                            ${status.index + 1}. <a href="<c:url value="/download/" />${file.sid}"><b>${file.originalName}</b></a> ${file.fileSize} (${file.downloadCnt} <spring:message code="bbs.download" />)
                        </div>
                        </c:forEach>
                        <div class="moddt">
                            <em>${spec.modifyDate} ${spec.modifyTime}</em>
                            <br />
                            <em>${spec.ip}</em>
                        </div>
                        
                        <div class="seperate"></div>
                        <div id="specTabs">
                        <ul>
                            <li><a href="#codeArea">Code</a></li>
                            <li><a href="#queryArea">Query</a></li>
                        </ul>
                        <div id="codeArea" class="memo">
                            <c:forEach items="${spec.codeList}" var="code" varStatus="status">
                            <c:if test="${not empty code.sourceCode}">
                            <div id="key${code.sid}">
                            <fieldset class="memofieldset" onmouseover="this.style.backgroundColor='#f1f6fb'" onmouseout="this.style.backgroundColor='#fefefe'">
                                <img src="<c:url value="/out/flags/${code.userCountry}.png" />" class="pw_bsc" />
                                <strong>${code.userNick}</strong>
                                <c:if test="${not empty code.userEmail}">
                                <img src="<c:url value="/img/skin/${project.projectSkin}/i_email.gif" />" class="pw_bsc" />
                                <span class="email">${code.userEmail}</span>
                                <span class="pw_eml_red">@</span>
                                </c:if>
                                <c:if test="${not empty code.userHomepage}">
                                <img src="<c:url value="/img/skin/${project.projectSkin}/i_home.gif" />" class="pw_bsc" /> 
                                <span class="homepage"><a href="${code.userHomepage}">${code.userHomepage}</a></span>
                                </c:if>
                                <br />
                                <br />
                                ${code.sourceType}<br />
                                ${code.sourcePackage}<br />
                                ${code.sourceName}<br />
                                ${code.interfaceName}<br />
                                <br />
                                <div class="content">${code.sourceCode}</div>
                                <span class="ip">
                                    <a href="<c:url value="/specCode/modify.do?sid=${code.sid}&amp;projectCode=${spec.projectCode}&amp;currentPage=${param.currentPage}&amp;command=MODIFY" />"><img src="<c:url value="/img/skin/${project.projectSkin}/i_memo_re.gif" />" class="pw_bsc" title="<spring:message code="specCode.modify" />" /></a>
                                    <img src="<c:url value="/img/skin/${project.projectSkin}/i_memo_x.gif" />" class="pw_bsc" title="<spring:message code="specCode.remove" />" onclick="codeRemove('${code.sid}');" />
                                    ${code.ip}
                                </span>
                                <span class="date" style="clear:both">${code.modifyDate} ${code.modifyTime}</span>
		                        <br />
		                        <br />
		                        <c:forEach items="${code.fileList}" var="file" varStatus="status">
		                        <div class="attach">
		                            ${status.index + 1}. <a href="<c:url value="/download/" />${file.sid}"><b>${file.originalName}</b></a> ${file.fileSize} (${file.downloadCnt} <spring:message code="bbs.download" />)
		                        </div>
		                        </c:forEach>
                            </fieldset>
                            </div>
                            </c:if>
                            </c:forEach>
                        </div>
                        
                        <div id="queryArea" class="memo">
                            <c:forEach items="${spec.queryList}" var="query" varStatus="status">
                            <c:if test="${not empty query.query}">
                            <div id="key${query.sid}">
                            <fieldset class="memofieldset" onmouseover="this.style.backgroundColor='#f1f6fb'" onmouseout="this.style.backgroundColor='#fefefe'">
                                <img src="<c:url value="/out/flags/${query.userCountry}.png" />" class="pw_bsc" />
                                <strong>${query.userNick}</strong>
                                <c:if test="${not empty query.userEmail}">
                                <img src="<c:url value="/img/skin/${project.projectSkin}/i_email.gif" />" class="pw_bsc" />
                                <span class="email">${query.userEmail}</span>
                                <span class="pw_eml_red">@</span>
                                </c:if>
                                <c:if test="${not empty query.userHomepage}">
                                <img src="<c:url value="/img/skin/${project.projectSkin}/i_home.gif" />" class="pw_bsc" /> 
                                <span class="homepage"><a href="${query.userHomepage}">${query.userHomepage}</a></span>
                                </c:if>
                                <br />
                                <br />
                                ${databaseType[query.databaseType]} - ${libraryType[query.libraryType]}<br />
                                <br />
                                <div class="content">${query.query}</div>
                                <span class="ip">
                                	<a href="<c:url value="/specQuery/modify.do?sid=${query.sid}&amp;projectCode=${spec.projectCode}&amp;currentPage=${param.currentPage}&amp;command=MODIFY" />"><img src="<c:url value="/img/skin/${project.projectSkin}/i_memo_re.gif" />" class="pw_bsc" title="<spring:message code="specQuery.modify" />" /></a>
                                    <img src="<c:url value="/img/skin/${project.projectSkin}/i_memo_x.gif" />" class="pw_bsc" title="<spring:message code="specQuery.remove" />" onclick="queryRemove('${query.sid}');" />
                                    ${query.ip}
                                </span>
                                <span class="date" style="clear:both">${query.modifyDate} ${query.modifyTime}</span>
                                <br />
                                <br />
		                        <c:forEach items="${query.fileList}" var="file" varStatus="status">
		                        <div class="attach">
		                            ${status.index + 1}. <a href="<c:url value="/download/" />${file.sid}"><b>${file.originalName}</b></a> ${file.fileSize} (${file.downloadCnt} <spring:message code="bbs.download" />)
		                        </div>
		                        </c:forEach>
                            </fieldset>
                            </div>
                            </c:if>
                            </c:forEach>
                        </div>
                        
                        </div>
                                                
                        <div class="seperate"></div>
            
                        <div class="memotag">
                            <strong>
                                <span id="memo" class="pw_fnt_out">
                                    <spring:message code="bbs.memo" /> ${spec.memoCnt}<spring:message code="bbs.apiece" />
                                </span>
                                |
                            </strong>
                            <strong>
                                <span id="tag" class="pw_fnt_out">
                                    <spring:message code="bbs.tag" /> ${spec.tagCnt}<spring:message code="bbs.apiece" />
                                </span>
                            </strong>
                        </div>
                        
                        <div id="tagArea" class="tag">
                            <div id="tagInput">
                                <fieldset class="showfieldset">
                                    <label for="tagName"><strong><spring:message code="bbs.tag" /></strong></label><br />
                                    <div class="pw_padding_w16">
                                        <input type="text" id="tagName" name="tagName" /> <form:errors path="tagName" />
                                        <a href="#" onclick="formSubmit('frmSpec', 'TAG_ADD', 'tagAdd.do')"><spring:message code="spec.button.tagSave" /></a>
                                        <label for="tagName"><spring:message code="bbs.tagDesc" /></label>
                                        <br />
                                        <c:forEach items="${spec.tagList}" var="tag" varStatus="status">
                                        <c:if test="${not empty tag.tagName}">
                                        <span class="pw_tag_out">${tag.tagName}</span> (${tag.hitCnt}) 
                                        </c:if>
                                        </c:forEach>
                                    </div>
                                </fieldset>
                            </div>
                        </div>

                        <div id="memoArea" class="memo">
                            <c:forEach items="${spec.memoList}" var="memo" varStatus="status">
                            <c:if test="${not empty memo.content}">
                            <div id="key${memo.sid}">
                            <fieldset class="memofieldset" onmouseover="this.style.backgroundColor='#f1f6fb'" onmouseout="this.style.backgroundColor='#fefefe'">
                                <c:if test="${memo.depth > 1}">
                                &nbsp;&nbsp;&nbsp;&nbsp;<c:forEach begin="2" end="${memo.depth}" step="1" var="space" varStatus="status">&nbsp;</c:forEach>
                                <img src="<c:url value="/img/skin/${project.projectSkin}/i_memo_reply.gif"/>" class="pw_bsc" />
                                </c:if>
                                <img src="<c:url value="/out/flags/${memo.userCountry}.png" />" class="pw_bsc" />
                                <strong>${memo.userNick}</strong><br />
                                <div class="content">${memo.content}</div>
                                <span class="ip">
                                    <img src="<c:url value="/img/skin/${project.projectSkin}/i_memo_re.gif" />" class="pw_bsc" title="<spring:message code="bbs.memoReply" />" onclick="memoInput('${memo.sid}', '${memo.depth}', 'REPLY');" />
                                    <img src="<c:url value="/img/skin/${project.projectSkin}/i_memo_x.gif" />" class="pw_bsc" title="<spring:message code="bbs.memoRemove" />" onclick="memoRemove('${memo.sid}');" />
                                    <img src="<c:url value="/img/skin/${project.projectSkin}/i_bad_off.gif" />" class="pw_bsc" title="<spring:message code="bbs.bad" />" />
                                    ${memo.ip}
                                </span>
                                <span class="date" style="clear:both">${memo.modifyDate} ${memo.modifyTime}</span>
                            </fieldset>
                            </div>
                            </c:if>
                            </c:forEach>
                            <div id="dialog" title="Delete Memo">
                            	<fieldset>
                            		<label for="password"><strong><spring:message code="bbs.userPasswd" /></strong></label>
                                    <input type="password" id="password" name="password" size="10" maxlength="16" />
                            	</fieldset>
                            </div>
                            <div id="memoInput">
                                <fieldset class="showfieldset">
                                <sec:authorize ifNotGranted="ROLE_USER">
                                    <label for="memoList0.userNick"><strong><spring:message code="bbs.userNick" /></strong></label> 
                                    <input type="text" id="memoList0.userNick" name="memoList[0].userNick" size="10" maxlength="32" /> <form:errors path="memoList[0].userNick" />
                                    <label for="memoList0.userPasswd"><strong><spring:message code="bbs.userPasswd" /></strong></label>
                                    <input type="password" id="memoList0.userPasswd" name="memoList[0].userPasswd" size="10" maxlength="16" /> <form:errors path="memoList[0].userPasswd" />
                                </sec:authorize>
                                <sec:authorize ifAnyGranted="ROLE_USER">
                                    <sec:authentication property="principal.username"/>
                                </sec:authorize>
                                    <a href="#" onclick="editFormSubmit('frmSpec', 'content')"><spring:message code="spec.button.memoSave" /></a>
                                </fieldset>
                                <div id="SAGAEditorBox" style="width: ${(project.specWidth - 4 - 20)}px; margin: 10px; height: 225px; z-index: 0; position: relative;" class="WebEditor_box">
                                    ${webEditor}
                                    <textarea id="content" name="memoList[0].content" cols="75" rows="7" class="WebEditor" style="display: none"></textarea>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    <div id="subMenuView">
                        <a href="<c:url value="/spec/list.do?projectCode=${spec.projectCode}" />"><spring:message code="spec.button.list" /></a> |
                        <a id="addMemo" href="#"><spring:message code="spec.button.memo" /></a> |
                        <a href="<c:url value="/spec/edit.do?projectCode=${spec.projectCode}&amp;command=ADD" />"><spring:message code="spec.button.add" /></a> |
                        <a href="<c:url value="/spec/modify.do?sid=${spec.sid}&amp;projectCode=${spec.projectCode}&amp;command=MODIFY" />"><spring:message code="spec.button.modify" /></a> |
                        <a href="<c:url value="/spec/remove.do?sid=${spec.sid}&amp;projectCode=${spec.projectCode}&amp;command=REMOVE" />"><spring:message code="spec.button.remove" /></a> |
                        <a href="<c:url value="/specCode/edit.do?specSid=${spec.sid}&amp;projectCode=${spec.projectCode}&amp;command=ADD" />"><spring:message code="spec.button.code" /></a> |
                        <a href="<c:url value="/specQuery/edit.do?specSid=${spec.sid}&amp;projectCode=${spec.projectCode}&amp;command=ADD" />"><spring:message code="spec.button.query" /></a> |
                        <a id="print" href="#" onclick="printPage('${spec.sid}');"><spring:message code="spec.button.print" /></a>
                    </div>
                </div>
                
            </div>
        </div>
    </div>        